<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('项目结算清单打印打印')" />
	<style type="text/css">
	body {
			overflow-x: auto;
		}
		table {
			font-size: 13px;
			font-weight:500;
			font-family: 线体;
			margin: auto;
	        border-collapse: collapse; 
		}
	    table, tr, td{
		    text-align: center;
		    width: 1500px;
		}
		.items td{ height:30px; border: 1px solid black;background-color: #e4dfec;}
		
		@media print{
		   body {
		       height: auto !important;
		   }
		}
	</style>
	<!-- 打印网页时通过hidden-print隐藏元素 -->
		<div class="text-right hidden-print">
	        <button class="btn btn-primary" onclick="printPage()"><i class="fa fa-print"></i> 打印</button>
	        <button class="btn btn-primary" onclick="tableToExcel('tables', 'name', 'myfile.xls')"><i class="fa fa-download"></i> 导出Excel</button>
	    	<a id="dlink"  style="display:none;"></a>
	    </div>
	<div id="tables">
	<table style="margin-top: 0px;" >
	    <tr style="height: 0px;">
			<td style="width: 10%">&nbsp;</td>
			<td style="width: 10%">&nbsp;</td>
			<td style="width: 10%">&nbsp;</td>
			<td style="width: 10%">&nbsp;</td>
			<td style="width: 10%">&nbsp;</td>
			<td style="width: 10%">&nbsp;</td>
			<td style="width: 10%">&nbsp;</td>
			<td style="width: 10%">&nbsp;</td>
			<td style="width: 10%">&nbsp;</td>
		</tr>
		<tr >
			<td><img style="height: 30px" src="/ruoyi.png"></td>
			<td colspan="8" style="font-size: 30px;font-family: 线体;font-weight:500;">广东建筑艺术设计院有限公司中南分公司【<span th:text="${years}"></span>】年项目管理结算表</td>
		</tr>
	</table>
	<table class="items">
		<input id="id" name="id" type="hidden" th:value="${gcProject.id}" />
		<tr>
			<td style="background-color: #ebf1de;" rowspan="2"><b>项目名称</b></td>
			<td style="background-color:#f2dcdb;" colspan="3" rowspan="2">
				<span th:text="${gcProject.name}"></span>
			</td>
			<td style="background-color: #ebf1de;" rowspan="2"><b>开票付款单位</b></td>
			<td style="background-color: #f2dcdb;" colspan="2" rowspan="2"><span th:text="${gcProject.customerName}"></span></td>
			<td style="background-color: #ebf1de;"><b>合同金额</b></td>
			<td style="background-color: #f2dcdb;"><span th:text="${#numbers.formatDecimal(xmxq.htje, 1, 2)}"></span></td>
			<td style="background-color: #ebf1de;"><b>签订日期</b></td>
			<td style="background-color: #f2dcdb;"><span th:text="${#dates.format(xmxq.riq, 'yyyy-MM-dd')}"></span></td>
			<td style="background-color: #ebf1de;" rowspan="2"><b>项目负责人</b></td>
			<td style="background-color: #f2dcdb;" rowspan="2"><span th:text="${gcProject.owner}"></span></td>
		</tr>
		<tr>
			<td style="background-color: #ebf1de;"><b>增值税税率</b></td>
			<td style="background-color:#f2dcdb;" ><span th:text="${xmxq.kpsl}"></span>%</td>
			<td style="background-color: #ebf1de;"><b>项目类型</b></td>
			<td style="background-color:#f2dcdb;">总承包</td>
		</tr>
		<tr>
			<td style="background-color:#ebf1de;" rowspan="2"><b>开票-时间/金额</b></td>
			<td style="background-color:#f2dcdb;"><span th:text="${#numbers.formatDecimal(xxfplis[0].je, 1, 2)}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${#numbers.formatDecimal(xxfplis[1].je, 1, 2)}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${#numbers.formatDecimal(xxfplis[2].je, 1, 2)}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${#numbers.formatDecimal(xxfplis[3].je, 1, 2)}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${#numbers.formatDecimal(xxfplis[4].je, 1, 2)}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${#numbers.formatDecimal(xxfplis[5].je, 1, 2)}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${#numbers.formatDecimal(xxfplis[6].je, 1, 2)}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${#numbers.formatDecimal(xxfplis[7].je, 1, 2)}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${#numbers.formatDecimal(xxfplis[8].je, 1, 2)}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${#numbers.formatDecimal(xxfplis[9].je, 1, 2)}"></span></td>
			<td style="background-color:#ebf1de;" rowspan="2"><b>开票金额</b></td>
			<td style="background-color:#f2dcdb;" rowspan="2"><span th:text="${#numbers.formatDecimal(xxfphj, 1, 2)}"></span></td>
		</tr>
		<tr>
			<td style="background-color:#f2dcdb;"><span th:text="${xxfplis[0].at}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${xxfplis[1].at}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${xxfplis[2].at}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${xxfplis[3].at}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${xxfplis[4].at}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${xxfplis[5].at}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${xxfplis[6].at}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${xxfplis[7].at}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${xxfplis[8].at}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${xxfplis[9].at}"></span></td>
		</tr>
		<tr>
			<td style="background-color: #ebf1de;" rowspan="2"><b>收款-时间/金额</b></td>
			<td style="background-color:#f2dcdb;"><span th:text="${#numbers.formatDecimal(jsjelis[0].je, 1, 2)}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${#numbers.formatDecimal(jsjelis[1].je, 1, 2)}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${#numbers.formatDecimal(jsjelis[2].je, 1, 2)}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${#numbers.formatDecimal(jsjelis[3].je, 1, 2)}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${#numbers.formatDecimal(jsjelis[4].je, 1, 2)}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${#numbers.formatDecimal(jsjelis[5].je, 1, 2)}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${#numbers.formatDecimal(jsjelis[6].je, 1, 2)}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${#numbers.formatDecimal(jsjelis[7].je, 1, 2)}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${#numbers.formatDecimal(jsjelis[8].je, 1, 2)}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${#numbers.formatDecimal(jsjelis[9].je, 1, 2)}"></span></td>
			<td style="background-color:#ebf1de;" rowspan="2"><b>结算金额</b></td>
			<td style="background-color:#f2dcdb;" rowspan="2"><span th:text="${#numbers.formatDecimal(fkje, 1, 2)}"></span></td>
		</tr>
		<tr>
			<td style="background-color:#f2dcdb;"><span th:text="${jsjelis[0].at}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${jsjelis[1].at}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${jsjelis[2].at}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${jsjelis[3].at}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${jsjelis[4].at}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${jsjelis[5].at}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${jsjelis[6].at}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${jsjelis[7].at}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${jsjelis[8].at}"></span></td>
			<td style="background-color:#f2dcdb;"><span th:text="${jsjelis[9].at}"></span></td>
		</tr>
		<tr>
			<td style="background-color: #ebf1de;"><b>支付时间</b></td>
			<td style="background-color: #ebf1de;"><b>支付金额</b></td>
			<td style="background-color: #ebf1de;"><b>成本比例</b></td>
			<td style="background-color: #ebf1de;"><b>支付事项摘要说明</b></td>
			<td style="background-color: #ebf1de;"><b>单位名称</b></td>
			<td style="background-color: #ebf1de;"><b>开票时间</b></td>
			<td style="background-color: #ebf1de;"><b>开票类型</b></td>
			<td style="background-color: #ebf1de;"><b>发票税率</b></td>
			<td style="background-color: #ebf1de;"><b>开票金额</b></td>
			<td style="background-color: #ebf1de;"><b>可抵扣税额</b></td>
			<td style="background-color: #ebf1de;" colspan="3"><b>项目核算【不含费用】</b></td>
		</tr>
		<tr th:each="fkfp : ${detaillis}">
			<td style="width: 7%;background-color: #FDE9D9;"><span th:text="${fkfp.zfsj}"></span></td>
			<td style="width: 7%;background-color: #FDE9D9;"><span th:text="${#numbers.formatDecimal(fkfp.zfje, 1, 2)}"></span></td>
			<td style="width: 7%;background-color: #FDE9D9;"><span th:text="${fkfp.cbbl}"></span></td>
			<td style="width: 18%;background-color: #FDE9D9;"><span th:text="${fkfp.descs}"></span></td>
			<td style="width:13%;background-color: #FDE9D9;"><span th:text="${fkfp.skdw}"></span></td>
			<td style="width: 6%;background-color: #FDE9D9;"><span th:text="${fkfp.kpsj}"></span></td>
			<td style="width: 6%;background-color: #FDE9D9;"><span th:text="${fkfp.kplx}"></span></td>
			<td style="width: 6%;background-color: #FDE9D9;"><span th:text="${fkfp.kpsl}"></span></td>
			<td style="width: 6%;background-color: #FDE9D9;"><span th:text="${#numbers.formatDecimal(fkfp.kpje, 1, 2)}"></span></td>
			<td style="width: 6%;background-color: #FDE9D9;"><span th:text="${fkfp.kdkse}"></span></td>
			<td style="width: 6%;background-color: #ebf1de;">&nbsp;</td>
			<td style="width: 6%;background-color: #ebf1de;">&nbsp;</td>
			<td style="width: 6%;background-color: #ebf1de;">&nbsp;</td>
		</tr>
		<tr>
			<td style="background-color: #ebf1de;"><b>合&nbsp;&nbsp;计</b></td>
			<td ><span th:text="${#numbers.formatDecimal(fkhjje, 1, 2)}"></span></td>
			<td colspan="6">&nbsp;</td>
			<td ><span th:text="${#numbers.formatDecimal(kphjje, 1, 2)}"></span></td>
			<td ><span th:text="${#numbers.formatDecimal(xxkdkse, 1, 2)}"></span></td>
			<td style="background-color: #ebf1de;" colspan="3">&nbsp;</td>
		</tr>
	</table>
	</div>
    <th:block th:include="include :: footer" />
    <script type="text/javascript">
        function printPage() {
            window.print();
        }
        
        var tableToExcel = (function () {
            var uri = 'data:application/vnd.ms-excel;base64,',
                template = '<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:x="urn:schemas-microsoft-com:office:excel" xmlns="http://www.w3.org/TR/REC-html40"><head><!--[if gte mso 9]><xml><x:ExcelWorkbook><x:ExcelWorksheets><x:ExcelWorksheet><x:Name>{worksheet}</x:Name><x:WorksheetOptions><x:DisplayGridlines/></x:WorksheetOptions></x:ExcelWorksheet></x:ExcelWorksheets></x:ExcelWorkbook></xml><![endif]--></head><body><table>{table}</table></body></html>',
                base64 = function (s) { return window.btoa(unescape(encodeURIComponent(s))) },
                format = function (s, c) { return s.replace(/{(\w+)}/g, function (m, p) { return c[p]; }) };
            return function (table, name, filename) {
                if (!table.nodeType) table = document.getElementById(table)
                var ctx = { worksheet: name || 'Worksheet', table: table.innerHTML }
    
                document.getElementById("dlink").href = uri + base64(format(template, ctx));
                document.getElementById("dlink").download = filename;
                document.getElementById("dlink").click();
            }
        })()
    </script>
</body>
</html>